Skip to content

release: attest exact sealed SBOM evidence - #797

Open
seonghobae wants to merge 27 commits into
mainfrom
release/exact-artifact-sbom-attestation
Open

release: attest exact sealed SBOM evidence#797
seonghobae wants to merge 27 commits into
mainfrom
release/exact-artifact-sbom-attestation

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Purpose

Add an organization-owned reusable SBOM attestation boundary for exact sealed wheel and source-distribution evidence, required by #783 and ContextualWisdomLab/EgressWeave#46.

Exact implementation head

Current exact head: 5295b562859b3e6d3a6d59446a45f2880882c7ca.

The final product diff contains only permanent implementation, quality, test, doctoring, and changelog files. All branch-local repair workflows, triggers, and encoded patch machinery were removed.

Trust boundary

  • Exposes only workflow_call with explicit required source, artifact, digest, filename, schema, and predicate inputs.
  • Binds trusted verifier checkout to immutable ${{ job.workflow_repository }} and ${{ job.workflow_sha }} rather than caller-controlled source.
  • Separates a read-only artifact-intake job from the credentialed signing job.
  • Grants the signer only contents: read, id-token: write, attestations: write, and artifact-metadata: write.
  • Uses the pinned actions/attest action exactly once for the wheel and once for the sdist.
  • Treats downloaded evidence as inert bounded data and never imports, builds, installs, tests, executes, or unpacks caller-controlled artifacts.
  • Requires exact six-file cardinality, strict UTF-8/JSON, SHA-256 digest closure, source identity, CycloneDX 1.7 semantics, root-component subject binding, and canonical checksum ordering.
  • Verifies online attestations and exports Sigstore bundles, trusted roots, the verified handoff manifest, and beginner-readable offline evidence.

Test-first verification

The final exact-head verifier run completed:

  • 39 focused contract and hostile-input tests;
  • production statement coverage 197/197;
  • production branch coverage 70/70;
  • production public-docstring coverage 100%; and
  • Python 3.14 compilation of implementation and contracts.

Python 3.10 compatibility is retained by the permanent quality workflow. docs/doctoring/exact-artifact-sbom-attestation.md records lifecycle, trust boundary, offline verification, incident recovery, rollback, nonclaims, and APA 7th primary sources. CHANGELOG.md records the capability under Unreleased.

Merge gate

Merge only after every required exact-current-head quality, security, supply-chain, CodeRabbit, OpenCode, Noema, independent non-author approval, unresolved-thread, and branch-protection gate succeeds without bypass.

Progresses #783.

Summary by CodeRabbit

  • 새로운 기능

    • 배포 파일과 SBOM의 무결성 및 SHA-256 일치 여부를 자동 검증합니다.
    • Wheel과 소스 배포본에 CycloneDX 1.7 SBOM 증명을 생성합니다.
    • 온라인·오프라인 검증 번들과 결정적 검증 매니페스트를 제공합니다.
    • 검증 결과를 90일간 아티팩트로 보관합니다.
  • 문서

    • SBOM 검증 절차, 신뢰 경계, 복구 및 롤백 지침을 추가했습니다.
  • 품질 개선

    • 누락·추가 파일, 잘못된 형식, 해시 불일치와 안전하지 않은 경로를 자동으로 감지합니다.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Implement the bounded GREEN slice for exact current RED head a26f09a9f6c403db1f4db334ec71299a97a4cd7c on branch release/exact-artifact-sbom-attestation.

The permanent exact-head RED workflow is valid:

  • run 31070177006, job Python 3.10 contract, succeeded;
  • run 31070177006, job Python 3.14 exact contract, failed at the contract with exactly 5 failures because the reusable workflow and doctoring were intentionally absent;
  • the failures are anchored to missing .github/workflows/exact-artifact-sbom-attestation.yml and docs/doctoring/exact-artifact-sbom-attestation.md, not syntax, dependency, checkout, or environment errors;
  • exact-head Security Scan, Secret Scan, OSV-Scanner, Scorecard, and SBOM Generation are successful; remaining security checks must still complete on the GREEN head.

Implement the organization-owned exact-artifact SBOM attestation boundary without changing reviewer identities, model credentials, existing review workflows, protected refs, release jobs, or package publication.

Allowed permanent paths

  • .github/workflows/exact-artifact-sbom-attestation.yml
  • .github/workflows/exact-artifact-sbom-attestation-quality.yml
  • scripts/ci/verify_exact_artifact_sbom_handoff.py
  • tests/test_exact_artifact_sbom_attestation_contract.py
  • new focused tests named tests/test_exact_artifact_sbom_*.py
  • docs/doctoring/exact-artifact-sbom-attestation.md
  • the central reusable-workflow catalogue or README only if needed to register this workflow
  • CHANGELOG.md

Do not add temporary, one-shot, self-modifying, branch-writing, repair, generated-patch, encoded-payload, or model-executing workflows.

Reusable workflow contract

Create .github/workflows/exact-artifact-sbom-attestation.yml with only workflow_call. Require every existing contract input as an explicit required string. Do not infer repository, source, file identity, or digests from mutable branches or filenames discovered at runtime.

Keep the workflow-level token read-only. Scope the credentialed attestation job to the reviewed minimum:

permissions:
  contents: read
  id-token: write
  attestations: write
  artifact-metadata: write

Do not grant package, release, pull-request, issue, ref, workflow, security-event, or repository-content write authority. Do not use secrets: inherit, COPILOT_GITHUB_TOKEN, NVIDIA_NIM_API_KEY, or any model provider.

Checkout the trusted verifier only from the immutable called-workflow identity:

repository: ${{ job.workflow_repository }}
ref: ${{ job.workflow_sha }}
persist-credentials: false

Use a separate trusted-control-plane path. Never checkout the caller repository, caller source SHA, a mutable central branch/tag, or downloaded evidence as executable source.

Download only the explicitly named same-run sealed evidence artifact into a separate untrusted-data path with an immutable official action pin. Verify the caller-supplied artifact digest against trusted GitHub artifact metadata or a cryptographically equivalent fail-closed receipt; GitHub's warning-only digest behavior must not be treated as success. If the platform does not expose a trustworthy exact digest without broadening privileges, fail closed and document the required caller receipt rather than silently weakening the contract.

Trusted verifier

Implement scripts/ci/verify_exact_artifact_sbom_handoff.py as standard-library-only, provider-neutral, data-only verification. It must never import distributions, execute hooks, invoke subprocesses, evaluate code, or extract wheel/sdist archives.

Before any attestation, require:

  • one canonical real evidence root with no symlinked final or ancestor component;
  • exactly six regular direct-child files: one canonical wheel, one canonical sdist, paired .cdx.json files, SOURCE_IDENTITY.json, and SHA256SUMS;
  • finite bounded descriptor reads and descriptor/path identity checks;
  • strict RFC 8259 JSON with duplicate-member and non-finite-number rejection;
  • canonical sorted SHA256SUMS covering exactly the five non-checksum payloads;
  • explicit filename and SHA-256 equality for every caller input;
  • canonical source identity whose repository and 40-character lowercase source SHA equal the explicit inputs;
  • exact CycloneDX 1.7 schema, bomFormat, specVersion, and integer document version;
  • exact root-component artifact SHA-256 and filename-property binding for each distribution;
  • canonical RFC UUIDv5 serial identity where applicable;
  • rehashing of every accepted file and checksum snapshot before emitting a deterministic strict verification manifest;
  • stable non-leaking failures and no runner-local paths or secrets in output.

The verifier must expose a narrow documented CLI and be independently testable without OIDC or GitHub APIs.

Signing and verification

Use immutable actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 exactly twice: once per canonical wheel and sdist. Bind each call to the verified subject name, exact sha256: digest, paired SBOM path, and expected CycloneDX predicate type. Do not rebuild or resolve dependencies.

Capture each action's bundle-path. Before any downstream publication can consume the result, run cryptographic verification against:

  • exact source repository;
  • exact source SHA;
  • signer repository;
  • exact reusable-workflow identity;
  • subject filename and digest;
  • expected CycloneDX predicate type.

Use GitHub CLI attestation verification only as a verifier; it must not publish, create releases, move refs, or mutate repository contents.

Offline evidence

Create a deterministic offline-verification directory containing at least:

  • the strict trusted verification manifest;
  • both Sigstore attestation bundles;
  • trusted-root material required for offline gh attestation verify;
  • a canonical SHA-256 manifest for the offline bundle;
  • beginner-readable offline verification commands and expected identity/predicate checks.

Upload this evidence with an immutable official action pin and finite retention. Keep wheel and sdist as the only package-manager publication inputs; SBOMs and bundles are evidence, not packages.

Quality gates

Extend .github/workflows/exact-artifact-sbom-attestation-quality.yml so the exact GREEN head runs:

  • Python 3.10 compatibility;
  • Python 3.14 focused and complete tests;
  • 100% production statement and branch coverage for the verifier;
  • 100% public docstrings for the verifier;
  • compileall for production and contract tests;
  • workflow source/permissions/action-pin tests;
  • malicious fixtures covering symlinks, nested files, oversized payloads, duplicate JSON keys, NaN/infinity, stale source, digest mismatch, filename mismatch, wrong predicate/schema/version, malformed checksum coverage, artifact cardinality drift, caller-code execution attempts, and output mutation.

Do not weaken existing central full-test coverage or security gates to make this slice pass.

Documentation

Write docs/doctoring/exact-artifact-sbom-attestation.md with:

  • architecture and credential-separation diagram;
  • trust boundary and nonclaims;
  • exact-head lifecycle;
  • caller contract and immutable pinning;
  • incident recovery and rollback;
  • workflow versioning;
  • online and offline verification;
  • SLSA wording restricted to SLSA Build Lx (v1.2) only after every normative requirement is mapped;
  • APA 7 references to CycloneDX 1.7, actions/attest v4.1.0 at the reviewed commit, official GitHub artifact-attestation and offline-verification documentation, in-toto, and SLSA 1.2.

Update CHANGELOG.md and the central workflow catalogue. Keep the PR Draft. Reproduce the complete exact-head central quality and security matrix. Do not ready, approve, auto-merge, merge, tag, release, or publish.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 45cd5cd6-d228-4cd0-beee-52813610821c

📥 Commits

Reviewing files that changed from the base of the PR and between e6fc914 and 5295b56.

📒 Files selected for processing (7)
  • .github/workflows/exact-artifact-sbom-attestation-quality.yml
  • .github/workflows/exact-artifact-sbom-attestation.yml
  • CHANGELOG.md
  • docs/doctoring/exact-artifact-sbom-attestation.md
  • scripts/ci/verify_exact_artifact_sbom_handoff.py
  • tests/test_exact_artifact_sbom_attestation_contract.py
  • tests/test_verify_exact_artifact_sbom_handoff.py
 ______________________________
< Here's looking at you, code. >
 ------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/exact-artifact-sbom-attestation

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@opencode-agent The exact current RED head advanced to 0beb249f1156c9e35c098df990c7f28fb54677f5 through one contract-only refinement; implement against this head, not a26f09a9f6c403db1f4db334ec71299a97a4cd7c.

The refinement closes the artifact-archive identity gap without granting extra authority to the OIDC signer:

  • evidence_artifact_id is now a required explicit input alongside name and digest;
  • a separate verify-evidence-artifact job may hold only actions: read and contents: read;
  • that non-OIDC intake job must query the exact artifact ID in inputs.source_repository and require exact name, SHA-256 digest, non-expired state, and .workflow_run.id == github.run_id before content verification;
  • the credentialed attest-exact-artifacts job must depend on that intake job and retain exactly contents: read, id-token: write, attestations: write, and artifact-metadata: write—no actions: read there;
  • both jobs download the same immutable artifact by exact ID with actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 and independently run the trusted content verifier;
  • content-level explicit digests remain the hard integrity gate after download, so the official action's warning-only archive digest behavior cannot silently authorize signing;
  • offline evidence must use actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a and include gh attestation trusted-root material.

No production, workflow, permission, or documentation implementation was added in this commit. Preserve the earlier immutable RED run and reproduce a new exact-current-head RED result before GREEN implementation. All other requirements in comment 5200275244 remain unchanged.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Fix only the two exact-current-head test-contract failures on 420032697629ffe31eb1943606cf0c346fe8f6e4; stop without writing if the branch head differs.

Root causes are confirmed from Exact Artifact SBOM Attestation Quality run 31132009382:

  1. test_artifact_intake_verifies_exact_immutable_same_run_metadata over-specifies the expression syntax by requiring literal ${{ github.run_id }}. The trusted reusable workflow correctly binds .workflow_run.id through the GitHub-provided immutable GITHUB_RUN_ID environment value (--argjson run_id "$GITHUB_RUN_ID"). Update the contract to require that actual same-run binding instead; do not weaken artifact ID/name/digest/repository/source/expiry checks and do not change the workflow.
  2. _valid_handoff(tmp_path / "again") and tmp_path / "third" fail before the intended cardinality assertions because the test fixture calls root.mkdir() without creating the supplied nested parent. Change the helper to create parents (root.mkdir(parents=True)); preserve all cardinality/non-regular/symlink behavior.

Modify only:

  • tests/test_exact_artifact_sbom_attestation_contract.py
  • tests/test_verify_exact_artifact_sbom_handoff.py

Run the focused contracts, complete verifier statement/branch coverage at 100%, public docstrings, Python 3.10 compilation, complete central test suite, and all current security checks. Do not modify production verifier code, reusable or quality workflows, doctoring, CHANGELOG, dependencies, credentials, permissions, refs, signing/attestation behavior, release/publication behavior, or any other path. Keep the PR draft and unmerged; report the new exact head and verification evidence.

@seonghobae
seonghobae marked this pull request as ready for review August 6, 2026 23:47
@seonghobae
seonghobae marked this pull request as draft August 6, 2026 23:50
@seonghobae
seonghobae marked this pull request as ready for review August 6, 2026 23:51

Copy link
Copy Markdown
Contributor Author

Release blocker: current exact scope contains three branch-repair/finalizer workflows (finalize-pr797-on-ready.yml, repair-pr797-exact-handoff.yml, repair-pr797-final-coverage.yml) plus a repair trigger. A signing-boundary PR must not carry PR-controlled automation that rewrites, commits, pushes, self-finalizes, or changes its own review state.

@opencode-agent address

Delete every finalizer, trigger, repair, materializer, source-snapshot, encoded-patch, and branch-writing workflow from the final tree. Publish the reusable attestation workflow, verifier, permanent quality workflow, tests, APA 7 doctoring, and direct CHANGELOG update through ordinary reviewed commits only.

Preserve the intended trust contract:

  • only workflow_call, with explicit repository, exact source SHA, sealed-artifact ID/digest, canonical wheel/sdist/SBOM filenames and digests, source/checksum digests, CycloneDX schema, and predicate type;
  • helper checkout bound to immutable ${{ job.workflow_repository }} and ${{ job.workflow_sha }};
  • signing permissions limited to contents: read, id-token: write, attestations: write, and artifact-metadata: write in the signing job only;
  • downloaded artifacts treated as inert bounded regular files: never import, install, build, test, execute, source, or unpack caller content;
  • strict JSON, exact six-file cardinality, repository/source identity, digest, CycloneDX 1.7, root-artifact and handoff verification before signing;
  • exactly one pinned actions/attest call per canonical distribution and cryptographic post-verification against exact predicate/signer identity;
  • offline Sigstore bundles and beginner-readable verification receipt;
  • no caller/model/file gains package, release, ref, PR, repository-write, OIDC, or signing authority.

Update the stale PR body to the actual current head and final permanent file set. Prove the permanent RED contract against protected main and GREEN after the ordinary implementation. Require Python 3.10/3.14, complete central tests, verifier 100% statement/branch/docstrings, compilation, all security/supply-chain checks, current-head CodeRabbit/OpenCode/Noema, zero valid threads, and qualifying non-author approval before Ready.

Copy link
Copy Markdown
Contributor Author

@jules Fix exact current head bade6d28340415799ea193854bc07741a9fb2281 directly with ordinary descendant commits; keep Draft.

Exact failing evidence: quality run 31132949110, job 92725893774. test_extra_missing_and_nonregular_members_fail_cardinality calls _valid_handoff(tmp_path / "again"); _valid_handoff() uses root.mkdir() and fails before exercising the verifier because the parent fixture directory does not exist. Change the fixture setup to create its parent hierarchy (root.mkdir(parents=True)) and rerun the focused tests and complete verifier branch coverage. Do not weaken the cardinality/nonregular-member assertions.

After GREEN, remove all transient PR repair/finalizer workflows from the final diff:

  • .github/workflows/finalize-pr797-on-ready.yml
  • .github/workflows/repair-pr797-exact-handoff.yml
  • .github/workflows/repair-pr797-final-coverage.yml
  • .github/workflows/trigger-pr797-exact-handoff-repair.yml

Retain only the permanent reusable signing workflow, permanent quality workflow, verifier, tests, APA 7 doctoring, and authoritative CHANGELOG material. Then run Python 3.10 compilation, Python 3.14 focused and complete central tests, 100% verifier statement/branch coverage, interrogate 100%, compileall, workflow syntax, security and supply-chain checks. Commit normally; no amend, force-push, Ready transition, approval, merge, release, OIDC/permission broadening, action-pin change, or protection change. Stop without mutation if the live head differs before writing.

@seonghobae
seonghobae marked this pull request as ready for review August 7, 2026 00:22
@seonghobae
seonghobae enabled auto-merge (squash) August 7, 2026 00:23
@opencode-agent
opencode-agent Bot disabled auto-merge August 7, 2026 00:27

Copy link
Copy Markdown
Contributor Author

@opencode-agent @cwl-noema-review @coderabbitai review

Review-only request for exact current head 5295b562859b3e6d3a6d59446a45f2880882c7ca against protected main e6fc91416c4fb13febd07b985c6e9c74fe888306. The final diff contains only permanent workflow, verifier, contracts, hostile-input tests, doctoring, and CHANGELOG files. A workflow-free same-head precursor completed 39 focused tests, 197/197 production statements, 70/70 production branches, and 100% public docstrings. Validate call-only inputs, immutable signer-source binding, least-privilege OIDC/attestation permissions, inert six-file evidence verification, CycloneDX 1.7 subject binding, online/offline attestation verification, and absence of transient repair machinery. Do not mutate the branch, approve as author, or merge; submit actionable findings or a formal exact-head review.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 13 minutes and 44 seconds before sending another message.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review
@opencode-agent review
@cwl-noema-review review

Final read-only exact-head review for 5295b562859b3e6d3a6d59446a45f2880882c7ca. Exact Artifact SBOM Attestation Quality 31135361921, Python 3.10 compatibility, Python 3.14 focused contracts, 197/197 production statements, 70/70 production branches, 100% public docstrings, CodeQL 31135361904, Python Security 31135361917, Semgrep 31135361942, Security Scan 31135361885, Secret Scan 31135361920, OSV 31135362248, Scorecard 31135361888, SBOM 31135361889, and CodeRabbit status are successful; no inline thread remains and auto-merge is armed. Revalidate the exact six-file sealed handoff, source/SHA/digest closure, CycloneDX 1.7 root-subject binding, intake/signer credential separation, immutable called-workflow source, two exact actions/attest invocations, online verification/offline bundle export, and absence of transient branch writers. Submit formal exact-head APPROVE only if no actionable defect remains. Do not mutate, manually merge, release, or alter protections.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 8 minutes and 13 seconds before sending another message.

Copy link
Copy Markdown
Contributor Author

@opencode-agent review

Review exact head 5295b562859b3e6d3a6d59446a45f2880882c7ca read-only. Exact Artifact SBOM Attestation Quality 31135361921, Python Security 31135361917, Security Scan 31135361885, CodeQL 31135361904, Semgrep 31135361942, Secret Scan 31135361920, OSV 31135362248, Scorecard 31135361888, and SBOM 31135361889 are successful; the permanent seven-file scope has zero unresolved threads and no repair/finalizer workflow. Verify immutable reusable-workflow checkout, exact artifact/source/digest/cardinality closure, inert bounded artifact handling, CycloneDX 1.7 root-subject binding, signer least privilege, exactly two pinned actions/attest calls, cryptographic post-verification, offline bundles, and absence of package/release/ref/PR write authority. Submit a qualifying non-author approval only if every exact-head gate passes.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review review

Independently review exact head 5295b562859b3e6d3a6d59446a45f2880882c7ca read-only, focusing on signer/verifier separation, immutable helper identity, exact sealed-artifact provenance, strict JSON/cardinality/digest validation, CycloneDX semantics, offline verification evidence, and least-privilege OIDC/attestation scope. Submit a current-head verdict only; do not mutate or merge.

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Implement the smallest coherent GREEN change for the exact current RED SBOM-attestation contract without rewriting fail-first history. Add a workflow_call-only reusable signing boundary with explicit repository/source SHA, sealed-artifact reference/digest, wheel/sdist/SBOM filenames and digests, source-identity/checksum digests, CycloneDX schema and predicate inputs; bind helper checkout to immutable job.workflow_repository/job.workflow_sha; grant only contents:read, id-token:write, attestations:write and artifact-metadata:write; treat downloaded artifacts as inert bounded data; independently verify exact six-file cardinality, digests, strict JSON, CycloneDX 1.7, root binding and handoff semantics before one actions/attest call per canonical distribution; verify resulting attestations and export offline Sigstore bundles. Require Python 3.10/3.14, complete central tests, 100% verifier statement/branch/docstrings, security/supply-chain gates, operator rollback/incident docs and APA 7 references. Do not merge, release, publish packages, use COPILOT_GITHUB_TOKEN, or alter protections.

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Review-only exact-head request for 5295b562859b3e6d3a6d59446a45f2880882c7ca. Validate immutable trusted-verifier source binding, six-file sealed evidence cardinality/digest closure, inert artifact handling, separated least-privilege signer authority, exact CycloneDX 1.7 subject binding, online/offline attestation evidence, 100% coverage/docstrings, and all successful exact-head security/supply-chain gates. Do not mutate the branch, attest real release artifacts, or merge.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review

Independently review exact head 5295b562859b3e6d3a6d59446a45f2880882c7ca, focusing on caller-versus-organization trust separation, digest and source identity closure, signer non-execution, predicate equality, offline verification completeness, and fail-closed malformed evidence behavior. Do not mutate the branch or merge.

Copy link
Copy Markdown
Contributor Author

@opencode-agent review
@cwl-noema-review review
@coderabbitai review

Perform a read-only independent review of exact head 5295b562859b3e6d3a6d59446a45f2880882c7ca. All current-head quality, security, and supply-chain workflows are successful and there are no unresolved review threads. Verify immutable reusable-workflow source identity, exact six-file digest/cardinality closure, inert bounded artifact handling, CycloneDX 1.7 root-subject binding, least-privilege signing permissions, exactly one pinned attestation per distribution, cryptographic post-verification, offline verification evidence, and absence of package/release/ref/PR write authority. Submit a qualifying non-author approval only if every exact-head gate passes; do not mutate the branch or bypass protection.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== HEAD and status =='
git rev-parse HEAD
git status --short
echo '== Base commit availability =='
git cat-file -t e6fc91416c4fb13febd07b985c6e9c74fe888306
echo '== Name-status diff from protected main =='
git diff --name-status e6fc91416c4fb13febd07b985c6e9c74fe888306..HEAD
echo '== Changed workflow paths =='
git diff --name-only e6fc91416c4fb13febd07b985c6e9c74fe888306..HEAD -- .github/workflows
echo '== Candidate files =='
fd -a -t f -E .git \
  '^(exact-artifact-sbom-attestation(\-quality)?\.yml|verify_exact_artifact_sbom_handoff\.py|test_exact_artifact_sbom_.*\.py|exact-artifact-sbom-attestation\.md|CHANGELOG\.md)$' .
echo '== Workflow structural outlines =='
ast-grep outline .github/workflows/exact-artifact-sbom-attestation.yml --items all || true
ast-grep outline .github/workflows/exact-artifact-sbom-attestation-quality.yml --items all || true
echo '== Verifier outline =='
ast-grep outline scripts/ci/verify_exact_artifact_sbom_handoff.py --items all || true

Length of output: 3760


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Reusable workflow =='
cat -n .github/workflows/exact-artifact-sbom-attestation.yml
echo '== Quality workflow =='
cat -n .github/workflows/exact-artifact-sbom-attestation-quality.yml
echo '== Verifier: complete implementation =='
cat -n scripts/ci/verify_exact_artifact_sbom_handoff.py
echo '== Targeted prohibited-operation and authority search =='
rg -n -i -C2 \
  '(subprocess|os\.system|os\.popen|eval\s*\(|exec\s*\(|__import__|importlib|tarfile|zipfile|shutil\.unpack_archive|pip\s|python\s+-m\s+pip|npm\s|docker|gh\s+(release|pr|api.*(POST|PATCH)|workflow\s+run)|git\s+(push|tag|commit|merge)|contents:\s*write|packages:\s*write|pull-requests:\s*write|issues:\s*write|actions:\s*write|secrets:\s*inherit|COPILOT_GITHUB_TOKEN|NVIDIA_NIM_API_KEY)' \
  .github/workflows/exact-artifact-sbom-attestation.yml \
  scripts/ci/verify_exact_artifact_sbom_handoff.py \
  docs/doctoring/exact-artifact-sbom-attestation.md \
  CHANGELOG.md || true
echo '== All action references in permanent workflows =='
rg -n -C1 '^\s*uses:\s*' .github/workflows/exact-artifact-sbom-attestation*.yml
echo '== Attestation and download/upload call counts =='
rg -n -C2 'actions/(attest|download-artifact|upload-artifact)@|gh attestation (verify|trusted-root)' \
  .github/workflows/exact-artifact-sbom-attestation*.yml

Length of output: 45625


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Contract tests =='
cat -n tests/test_exact_artifact_sbom_attestation_contract.py
echo '== Verifier hostile-input tests =='
cat -n tests/test_verify_exact_artifact_sbom_handoff.py
echo '== Doctoring =='
cat -n docs/doctoring/exact-artifact-sbom-attestation.md
echo '== Required-control terms across permanent files =='
rg -n -i -C2 \
  '(NaN|Infinity|parse_constant|serialNumber|UUID|uuidv5|filename.*propert|properties|document version|checksum manifest|SHA256SUMS|offline.*command|trusted.root|rollback|incident|SLSA)' \
  .github/workflows/exact-artifact-sbom-attestation.yml \
  scripts/ci/verify_exact_artifact_sbom_handoff.py \
  tests/test_exact_artifact_sbom_attestation_contract.py \
  tests/test_verify_exact_artifact_sbom_handoff.py \
  docs/doctoring/exact-artifact-sbom-attestation.md
echo '== All workflow triggers and potential branch-write commands in final tree =='
rg -n -i -C2 \
  '(^\s*(pull_request_target|workflow_dispatch|schedule|push|pull_request|workflow_call):|git\s+(push|commit|tag|merge)|gh\s+(pr|release|api|workflow)|contents:\s*write|pull-requests:\s*write|issues:\s*write|actions:\s*write|packages:\s*write)' \
  .github/workflows

Length of output: 124693


@seonghobae I completed a read-only review of 5295b562859b3e6d3a6d59446a45f2880882c7ca.

The workflow scope and trust separation are correct. The workflow is workflow_call-only. It uses immutable verifier checkout. It separates artifact intake from signing. It limits signer permissions. It uses the pinned actions/attest action exactly twice.

I cannot approve this head because the following actionable defects remain.

  1. P1 — Reject non-finite JSON values.
    scripts/ci/verify_exact_artifact_sbom_handoff.py, Line 48, calls json.loads() without parse_constant. Python accepts NaN, Infinity, and -Infinity by default. These values are not valid RFC 8259 JSON. Add a rejecting parse_constant handler and hostile-input tests that reseal SBOM and source-identity fixtures containing each value.

  2. P1 — Complete CycloneDX subject binding validation.
    scripts/ci/verify_exact_artifact_sbom_handoff.py, Lines 131-145, validates schema URI, format, specification version, root component name, and SHA-256. It does not validate the required integer BOM version, root-component filename property, or canonical UUIDv5 serial identity. A resealed SBOM can therefore omit or alter these required semantics and still reach actions/attest. Validate each required field and add negative tests.

  3. P2 — Reject symlinked ancestor components of the evidence root.
    scripts/ci/verify_exact_artifact_sbom_handoff.py, Lines 178-181, checks only whether the final evidence_root component is a symlink. A path such as linked-parent/sealed-evidence passes when linked-parent is a symlink. Check every path component with lstat() before resolving the root. Add an ancestor-symlink test.

  4. P2 — Export a canonical integrity manifest with the offline evidence.
    .github/workflows/exact-artifact-sbom-attestation.yml, Lines 219-248, exports bundles, trusted root material, and the verifier manifest. It does not create the required canonical SHA-256 manifest for those offline-evidence files. Generate a sorted checksum manifest after all files are copied. Include the offline verification instructions or receipt in the uploaded directory so an operator can verify the bundle without separately locating repository documentation.

I did not approve the pull request.

Action performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review
@opencode-agent review
@cwl-noema-review review
@strix review

Final read-only review for exact head 5295b562859b3e6d3a6d59446a45f2880882c7ca. Exact Artifact SBOM Attestation Quality, CodeQL, Python Security, SAST, Security Scan, Secret Scan, OSV, Scorecard, and SBOM are successful. Verify immutable verifier source, six-file evidence cardinality, CycloneDX 1.7/root-subject digest closure, inert artifact handling, least-privilege OIDC/attestation permissions, and online/offline verification bundles. Submit a qualifying non-author approval only if no actionable finding remains. Do not mutate the branch, bypass protections, or merge.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

expected_head='5295b562859b3e6d3a6d59446a45f2880882c7ca'
base='e6fc91416c4fb13febd07b985c6e9c74fe888306'

echo '== Exact head =='
git rev-parse HEAD
git status --short
test "$(git rev-parse HEAD)" = "$expected_head"

echo '== Diff scope from protected main =='
git diff --name-status "$base..HEAD"

echo '== Candidate file outlines =='
ast-grep outline .github/workflows/exact-artifact-sbom-attestation.yml --items all || true
ast-grep outline scripts/ci/verify_exact_artifact_sbom_handoff.py --items all || true
ast-grep outline tests/test_verify_exact_artifact_sbom_handoff.py --items all || true

echo '== Workflow trigger, permissions, actions, checkout, and verification commands =='
rg -n -C3 \
  '(^on:|workflow_call|permissions:|contents:|id-token:|attestations:|artifact-metadata:|actions:|repository:|ref:|persist-credentials:|uses:|actions/attest@|download-artifact@|upload-artifact@|gh attestation|SHA256|offline)' \
  .github/workflows/exact-artifact-sbom-attestation.yml

echo '== Verifier safeguards and CycloneDX semantics =='
rg -n -C4 \
  '(json\.loads|parse_constant|NaN|Infinity|lstat|symlink|is_symlink|resolve|SHA256SUMS|serialNumber|uuid|version|bomFormat|specVersion|properties|filename|manifest|subprocess|tarfile|zipfile|import |exec\(|eval\()' \
  scripts/ci/verify_exact_artifact_sbom_handoff.py

echo '== Contract coverage for safeguards =='
rg -n -C2 \
  '(NaN|Infinity|symlink|ancestor|serialNumber|uuid|version|filename.property|offline|SHA256SUMS)' \
  tests/test_exact_artifact_sbom_attestation_contract.py \
  tests/test_verify_exact_artifact_sbom_handoff.py

echo '== Transient workflow candidates =='
fd -a -t f . .github/workflows | rg -i '(finalize|repair|trigger|materializ|snapshot|patch)'

Length of output: 28752


@seonghobae I completed a read-only review of exact head 5295b562859b3e6d3a6d59446a45f2880882c7ca.

I cannot approve this pull request. Four actionable defects remain.

  1. P1: Reject non-finite JSON values.
    scripts/ci/verify_exact_artifact_sbom_handoff.py, Line 48, calls json.loads() without a rejecting parse_constant handler. Python accepts NaN, Infinity, and -Infinity by default. These values violate RFC 8259. Reject these constants and add resealed hostile-input tests for SBOM and source-identity files.

  2. P1: Complete CycloneDX root-subject validation.
    scripts/ci/verify_exact_artifact_sbom_handoff.py, Lines 123-145, validates the schema, format, specVersion, root name, and SHA-256 hash. It does not validate the required integer BOM version, root-component filename property, or canonical UUIDv5 serialNumber. A resealed SBOM can alter or omit these semantics and still reach actions/attest. Validate each field and add negative tests.

  3. P2: Reject a symlinked ancestor of the evidence root.
    scripts/ci/verify_exact_artifact_sbom_handoff.py, Lines 178-181, rejects a symlink only when the final evidence-root component is a symlink. An evidence root below a symlinked parent passes this check after resolve(). Use lstat() to validate every ancestor component before resolving the path. Add an ancestor-symlink test.

  4. P2: Make the offline evidence bundle self-verifying.
    .github/workflows/exact-artifact-sbom-attestation.yml, Lines 219-248, exports the bundles, trusted root, and verifier manifest. It does not create a canonical sorted SHA-256 manifest for these exported files. It also does not copy offline verification instructions or an operator receipt into the uploaded directory. Generate the checksum manifest after all files are present and include local verification instructions.

The workflow has the required call-only trigger, immutable verifier checkout, intake/signer permission separation, and two pinned actions/attest calls. The defects above prevent a qualifying approval.

Action performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant